package com.aspose.cells;

class zbpu implements zaia {
   private FindOptions a;
   private String b;
   private zaia c;
   private com.aspose.cells.b.a.g.a.ze d;

   zbpu(String var1, FindOptions var2) {
      this.a = var2;
      if (var2.getRegexKey()) {
         switch(this.a.getLookAtType()) {
         case 1:
            if (!var1.startsWith("^")) {
               var1 = "^" + var1;
            }
            break;
         case 2:
            if (!var1.endsWith("$")) {
               var1 = var1 + "$";
            }
         }

         this.d = new com.aspose.cells.b.a.g.a.ze(var1, var2.getCaseSensitive() ? 0 : 66);
      } else {
         switch(this.a.getLookAtType()) {
         case 3:
            this.c = new zbpv(var1, !var2.getCaseSensitive());
            break;
         default:
            if (var2.getCaseSensitive()) {
               this.b = var1;
            } else {
               this.b = var1.toUpperCase();
            }
         }
      }

   }

   public boolean a(String var1) {
      switch(this.a.getLookAtType()) {
      case 0:
         if (this.a.getRegexKey()) {
            return this.d.d(var1);
         }

         if (!this.a.getCaseSensitive()) {
            var1 = var1.toUpperCase();
         }

         return var1.indexOf(this.b) != -1;
      case 1:
         if (!this.a.getCaseSensitive()) {
            var1 = var1.toUpperCase();
         }

         return var1.startsWith(this.b);
      case 2:
         if (!this.a.getCaseSensitive()) {
            var1 = var1.toUpperCase();
         }

         return var1.endsWith(this.b);
      case 3:
         if (this.a.getRegexKey()) {
            return this.d.d(var1);
         }

         return this.c.a(var1);
      default:
         return false;
      }
   }
}
